package untiring.beans;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import untiring.interfaces.BoardDAO;
import untiring.models.BoardVO;

@Repository("boardDAO")
public class BoardDAOImpl implements BoardDAO{
	
	@Autowired
	private SqlSession sqlSession;
	
	@Override
	public boolean insertBoard(BoardVO b) {
		boolean result = false;
		
		if(sqlSession.insert("boardMapper.insertBoard",b)>0 )result = true;
		return result;
	}

	@Override
	public List<BoardVO> selectBoard() {
		return sqlSession.selectList("boardMapper.selectBoard");
	}

	@Override
	public BoardVO selectOneBoard(String bno) {
		return sqlSession.selectOne("boardMapper.selectOneBoard",bno);
	}

	@Override
	public boolean updateBoard(BoardVO b) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean deleteBoard(String bno) {
		// TODO Auto-generated method stub
		return false;
	}

}
